#include "gpubackprop.cuh"
#include <iostream>

int main()
{
/*  float *data = new float[8],*test = new float[3];
  data = { 0,0,1,1,0,1,1,0 };
  test = { 0,1,1 };
*/
  float data[][21] = { 0,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,1,1,1,1,1,
                       0,1,1,1,0,0,0,1,1,0,1,1,0,0,0,0,0,1,1,0,0 };
  float test[][20] =   { 0,1,1,1,0,0,0,1,1,0,1,1,0,0,0,0,0,1,1,0 };
  unsigned int nL = 4, lSz[4] = { 20,7,8,1 };
  float beta = 0.3,alpha = 0.1,thresh = 0.000001;
  long it = 1000000;

  __gpuBackProp bp(nL,1,lSz,beta,alpha);

  bp(data[
//  __gpuBackProp *bp = new __gpuBackProp(nL,2,lSz,beta,alpha);

/*
  std::cout << "\nNow Training the network ... \n";
  long i=0;
  for (i=0; i<it; ++i) {
    bp(data[i%2],&data[i%2][20]);

    if (bp.mse(&data[i%2][20]) < thresh) {
      std::cout << "\nNetwork trained. Threshold achieved in " << i <<
        " iterations.\n";
      std::cout << "MSE: " << bp.mse(&data[i%2][20]) << "\n";
      break;
    }

    if (i % (it/10) == 0)
      std::cout << "\nMSE: " << bp.mse(&data[i%2][20]) <<
        "... Training ...\n";
  }

  if (i == it)
    std::cout << i << " iterations completed..." << "MSE: " <<
      bp.mse(&data[(i-1)%2][20]) << "\n";

  std::cout << "Now using the trained network to make predictions on test data...\n\n";

  bp(test[0]);
  std::cout << bp.out(0) << "\n";
*/
  return 0;
}
